package com.you.common.ibatis.data;

import java.util.List;

public class DataList {

    private List data;
    private int  pageNo;
    private int  pageSize;
    private int  totalPage;
    private long totalCount;

    public int prePage() {
        return Math.max(1, pageNo - 1);
    }

    public int nextPage() {
        return Math.min(totalPage, pageNo + 1);
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

}
